package decorator.b;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

public class FileIoTest {

	public static void main(String[] args) {
		
		String filePath = "test.txt";
		File file = new File(filePath);
		InputStream inputStream = null;
		
		try {
			inputStream = new LowercaseInputStream(new UppercaseInputStream(
					new FileInputStream(file)));
			
			int data;
			
			while ((data = inputStream.read()) != -1) {
				
				System.out.print((char)data);
			}
			
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			try {
				if (inputStream != null) inputStream.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}

}
